﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProjectBase.Core.PersistenceSupport;
using ProjectBase.Core;

namespace SLSYJ.Core
{
    public class Category : PersistentObject, ICategory
    {
        protected Category() {
            this.InitMembers();
        }
        
        public Category(string name) {
            Check.Require(!String.IsNullOrEmpty(name), "name may not be null or empty");
            Name = name;
        }

        [DomainSignature]
        public virtual string Name { get; set; }

        public virtual decimal GrossSalary { get; set; }

        public virtual IList<Task> CategoryTasks { get; set; }

        protected override string GetDomainObjectSignature()
        {
            return Name;
        }

        private void InitMembers()
        {
            CategoryTasks = new List<Task>();
        }

        #region ICategory Members

        public virtual decimal GetBasicSalary()
        {
            return this.GrossSalary;
        }

        #endregion
    }
}
